<?php

use app\middleware\CarMiddleware;
use think\facade\Route;
use think\middleware\AllowCrossDomain;
use think\middleware\SessionInit;

$middleware = [
    //     全局请求缓存
//    CheckRequestCache::class,
//     Session初始化
    SessionInit::class,
    CarMiddleware::class,
    AllowCrossDomain::class
];
Route::group("car_sys",function (){
    Route::post("login","car.Auth/login");
    Route::any("check_login","car.Auth/check");
    Route::group("driver",function (){
        Route::post("save","car.driver/save");
        Route::get("count","car.driver/number");
        Route::get("lst","car.driver/lst");
        Route::any("download","car.driver/download");
        Route::post("update_state","car.driver/updateState");
        Route::post("recharge","car.driver/recharge");
    });
    Route::group("driver_balance",function (){
        Route::get("lst","car.driver_balance/lst");
    });
    Route::group("bill",function (){
        Route::group("gas",function (){
            Route::get("list","car.gas/lst");
            Route::any("export","car.gas/download");
        });
    });
})->middleware($middleware);
